package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiL2VpnQoslspMapper;
import com.ruoyi.net.domain.BusiL2VpnQoslsp;
import com.ruoyi.net.service.IBusiL2VpnQoslspService;

/**
 * 业务-L2 VPN qos-lspService业务层处理
 * 
 * @author net
 * @date 2024-12-15
 */
@Service
public class BusiL2VpnQoslspServiceImpl implements IBusiL2VpnQoslspService 
{
    @Autowired
    private BusiL2VpnQoslspMapper busiL2VpnQoslspMapper;

    /**
     * 查询业务-L2 VPN qos-lsp
     * 
     * @param id 业务-L2 VPN qos-lsp主键
     * @return 业务-L2 VPN qos-lsp
     */
    @Override
    public BusiL2VpnQoslsp selectBusiL2VpnQoslspById(String id)
    {
        return busiL2VpnQoslspMapper.selectBusiL2VpnQoslspById(id);
    }

    /**
     * 查询业务-L2 VPN qos-lsp列表
     * 
     * @param busiL2VpnQoslsp 业务-L2 VPN qos-lsp
     * @return 业务-L2 VPN qos-lsp
     */
    @Override
    public List<BusiL2VpnQoslsp> selectBusiL2VpnQoslspList(BusiL2VpnQoslsp busiL2VpnQoslsp)
    {
        return busiL2VpnQoslspMapper.selectBusiL2VpnQoslspList(busiL2VpnQoslsp);
    }

    /**
     * 新增业务-L2 VPN qos-lsp
     * 
     * @param busiL2VpnQoslsp 业务-L2 VPN qos-lsp
     * @return 结果
     */
    @Override
    public int insertBusiL2VpnQoslsp(BusiL2VpnQoslsp busiL2VpnQoslsp)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiL2VpnQoslsp.getId())) {
            busiL2VpnQoslsp.setId(uuid);
        }
        busiL2VpnQoslsp.setCreateBy(SecurityUtils.getUsername());
        busiL2VpnQoslsp.setCreateTime(DateUtils.getNowDate());
        busiL2VpnQoslsp.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnQoslsp.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnQoslspMapper.insertBusiL2VpnQoslsp(busiL2VpnQoslsp);
    }

    /**
     * 修改业务-L2 VPN qos-lsp
     * 
     * @param busiL2VpnQoslsp 业务-L2 VPN qos-lsp
     * @return 结果
     */
    @Override
    public int updateBusiL2VpnQoslsp(BusiL2VpnQoslsp busiL2VpnQoslsp)
    {
        busiL2VpnQoslsp.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnQoslsp.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnQoslspMapper.updateBusiL2VpnQoslsp(busiL2VpnQoslsp);
    }

    /**
     * 批量删除业务-L2 VPN qos-lsp
     * 
     * @param ids 需要删除的业务-L2 VPN qos-lsp主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnQoslspByIds(String[] ids)
    {
        return busiL2VpnQoslspMapper.deleteBusiL2VpnQoslspByIds(ids);
    }

    /**
     * 删除业务-L2 VPN qos-lsp信息
     * 
     * @param id 业务-L2 VPN qos-lsp主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnQoslspById(String id)
    {
        return busiL2VpnQoslspMapper.deleteBusiL2VpnQoslspById(id);
    }
}
